package com.gxitsky.callback;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author gxing
 * @desc TODO
 * @date 2022/2/10
 */
@Service
public class OrderServiceImpl implements OrderService {
    private Logger logger = LoggerFactory.getLogger(OrderServiceImpl.class);

    @Autowired
    private PayService payService;

    @Override
    public void toPay(String order) {
        CallbackListener listener = new CallbackListener() {
            @Override
            public void notify(String result) {
                logger.info("pay result:" + result);
            }
        };
        payService.toPay("order", listener);
    }
}
